<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.io.*"%>
<%@ page import="xml.response.*"%>
<%@ page import="xml.root"%>
<%@ page import="util.print.printLogCat"%>
<%@ page import="org.sql.table.*"%>
<%@ page import="xml.var"%>
<%@ page import="java.util.Vector"%>
<%@ page import="java.util.Enumeration"%>
<%@ page import="jqgrid.jqgrid"%>
<%@ page import="org.util.getNewData"%>
<%@ page import="requestInterFace.Handle.*"%>
<%@ page import="org.util.SerialNumberUtil"%>
<%@ include file="../../util/paramPrint.jsp" %>
<%@ page import="org.msg.msg"%>
<%@ page import="util.check"%>
<%@ page trimDirectiveWhitespaces="true" %> 
<%
String Order_ID = request.getParameter("Order_ID");
String Info = request.getParameter("Info");
String User_ID = request.getParameter("User_ID");
String Order_Name = request.getParameter("Order_Name");
String Order_Products = request.getParameter("Order_Products");
String Product_Num = request.getParameter("Product_Num");
String userType=(String)session.getAttribute("User_Type");
String userID=(String)session.getAttribute("User_ID");
root root=new root();
/*if(userType==null||!userType.equals("1")){
root.setStatus("false");
root.setMsg("权限不够");
PrintWriter pw = response.getWriter();
pw.println(root.getXmlString());
pw.flush();
return ;
}*/
if(!check.checkString(Order_Name)){
	root.setStatus("false");
	root.setMsg("请输入正确订单类型");
PrintWriter pw = response.getWriter();
pw.println(root.getXmlString());
pw.flush();
return ;
}
if(Order_Name.equals(orderinfo1_1.getMain_Order_Name())){
if(!check.checkString(User_ID)){
	root.setStatus("false");
	root.setMsg("请输入正确用户ID");
PrintWriter pw = response.getWriter();
pw.println(root.getXmlString());
pw.flush();
return ;
}
orderHandle orderHandle=new orderHandle();
if(!check.checkString(Info)){
Info=User_ID;
}
msg mag=orderHandle.addOrderProduct("",orderinfo1_1.getMain_Order_Name(),"","",java.net.URLDecoder.decode(User_ID,"UTF-8"),java.net.URLDecoder.decode(Info,"UTF-8"));
if(mag.isSuc()){
			root.setStatus("true");
			root.setMsg(""+mag.getMsg());
		}else{
			root.setStatus("false");
			root.setMsg(""+mag.getError());
		}
	
}else if(Order_Name.equals(orderinfo.getProduct_Order_Name())){
	if(!check.checkString(Order_ID)||!check.checkString(User_ID)||!check.checkString(Order_Name)||!check.checkString(Order_Products)||!check.checkString(Product_Num)){
	root.setStatus("false");
	root.setMsg("请输入正确值");
PrintWriter pw = response.getWriter();
pw.println(root.getXmlString());
pw.flush();
return ;
}
orderHandle orderHandle=new orderHandle();
msg mag=orderHandle.addOrderProduct(Order_ID,orderinfo1_1.getProduct_Order_Name(),Order_Products,Product_Num,java.net.URLDecoder.decode(User_ID,"UTF-8"),java.net.URLDecoder.decode(Info,"UTF-8"));
if(mag.isSuc()){
			root.setStatus("true");
			root.setMsg(""+mag.getMsg());
		}else{
			root.setStatus("false");
			root.setMsg(""+mag.getError());
		}
	
}else{
	root.setStatus("false");
	root.setMsg("订单类型不正确");
PrintWriter pw = response.getWriter();
pw.println(root.getXmlString());
pw.flush();
return ;
}

	
		//printLogCat.printlnWriter(root.getXmlString());
		String rep=root.getXmlString();
%>
<%=rep%>



